package com.example.admin.yuejian_22.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;

import com.example.admin.yuejian_22.Fragment.MainFragment;
import com.example.admin.yuejian_22.R;

public class HomeActivity extends AppCompatActivity{
    private FragmentManager fragmentManager;
    private FragmentTransaction transaction;
    private MainFragment mainFragment;
    private SharedPreferences preferences;
    private final String fileName = "yuejain";
    private final int mode = MODE_PRIVATE;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.activity_home);
        preferences = getSharedPreferences(fileName,mode);
        fragmentManager = getSupportFragmentManager();
        transaction = fragmentManager.beginTransaction();

        mainFragment = new MainFragment();
        transaction.add(R.id.fragment_holder,mainFragment);

        transaction.commit();
    }
}
